<div class="depot-form">
  <%= error_messages_for :block %>
  <fieldset>
    <legend>Enter Block Details</legend>
    <% form_for :block do |form| %>
      <p>
        <label for="block_name">Name:</label>
        <%= form.text_field :name, :size => 80 %>
      </p>
      <p>
        <label for="block_content">Text:</label>
        <%= form.text_area :content, :cols => 60, :rows => 20 %>
      </p>
      <p>
        <label for="block_visible">Visible:</label>
        <%= form.check_box :visible %>
      </p>
      <%= submit_tag "Submit", :class => "submit" %>
      <%= submit_to_remote "commit", "Preview", :class => "submit", :url => {:action => "preview"}, 
          :update => "preview",
          :loading => 'Element.show("loading")', 
          :complete => 'Element.hide("loading")' %>
      <% end %>
  </fieldset>
</div>
<%= image_tag("ajax-loader.gif", :id => 'loading', :style => 'display:none') %>
<div id="preview"></div>